import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus';
import 'element-plus/theme-chalk/index.css';
import locale from 'element-plus/dist/locale/zh-cn.min.js'
import http from "./common/http.js";

import {ElMessageBox} from 'element-plus';
import {ElMessage} from 'element-plus'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App)
app.use(router) //挂载路由插件
app.use(ElementPlus, {locale})//挂载ElementUl-Plus插件
//挂载图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

//全局Ajax公共函数
app.config.globalProperties.$http = http;
app.config.globalProperties.$message = ElMessage;
app.config.globalProperties.$messageBox = ElMessageBox;

app.mount('#app')//挂载到index.html的app节点
